package com.qlk.odcinterface.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.odcinterface.dao.PmsProductPromotionChannelDao;
import com.qlk.odcinterface.domain.PmsProductPromotion;
import com.qlk.odcinterface.domain.PmsProductPromotionChannel;
import com.qlk.odcinterface.domain.query.PmsProductPromotionChannelQuery;

import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * PmsProductPromotionChannelDAO实现类<br/>
 * 对'单品促销渠道对应表表'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-4-14 13:22:58
 * 
 */
@Repository
public class PmsProductPromotionChannelDaoImpl extends BaseDao implements PmsProductPromotionChannelDao {
    /** namespace */
    private final String namespace = PmsProductPromotionChannelDaoImpl.class.getName();
    
    /**
     * {@inheritDoc}
     */
    public List<PmsProductPromotionChannel> queryPmsProductPromotionChannelList(PmsProductPromotionChannelQuery queryBean) {
        return (List<PmsProductPromotionChannel>) queryForList(namespace +".queryPmsProductPromotionChannelList", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean insert(PmsProductPromotionChannel pmsProductPromotionChannel) {
        return insert(namespace +".insert", pmsProductPromotionChannel);
    }

    /**
     * {@inheritDoc}
     */
    public boolean update(PmsProductPromotionChannel pmsProductPromotionChannel) {
        return update(namespace +".update", pmsProductPromotionChannel);
    }

    /**
     * {@inheritDoc}
     */
    public int queryPmsProductPromotionChannelCount(PmsProductPromotionChannelQuery queryBean) {
        return (Integer) queryForObject(namespace +".queryPmsProductPromotionChannelCount", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public List<PmsProductPromotionChannel> queryPmsProductPromotionChannelListWithPage(PmsProductPromotionChannelQuery queryBean) {
        return (List<PmsProductPromotionChannel>) queryForList(namespace +".queryPmsProductPromotionChannelListWithPage", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean delete(PmsProductPromotionChannel configuration) {
        return delete(namespace +".delete", configuration);
    }
    
    public boolean deletePmsProductPromotionChannel(PmsProductPromotionChannel configuration) {
        return delete(namespace +".deletePmsProductPromotionChannel", configuration);
    }
    
    /**
     * {@inheritDoc}
     */
    public PmsProductPromotionChannel getPmsProductPromotionChannelById(Integer id) {
        return (PmsProductPromotionChannel) queryForObject(namespace +".getPmsProductPromotionChannelById", id);
    } 
    
    /**
     * {@inheritDoc}
     */
    public boolean exist(PmsProductPromotionChannel pmsProductPromotionChannel) {
        int count = (Integer) queryForObject(namespace +".exist", pmsProductPromotionChannel);
        return count > 0;
    }
}
